﻿@model IEnumerable<Lost_and_Found.Models.DB.User>
@{
    ViewBag.Title = "User";
    Layout = "~/Views/Shared/_Backend.cshtml";
}
<div class="row">
    <h1 class="page_title" style="float: left;">Quản lí người dùng</h1>
    <span id="new_user" class="label">@Html.ActionLink("Tạo mới", "NewUser", "Administrator")</span>
</div>

<table class="wp-list-table widefat fixed users table table-hover">
    <thead>
        <tr>
            <th>Username</th>
            <th>Tên đầy đủ</th>
            <th>Email</th>
            <th>Quyền</th>
            <th>Thao tác</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var user in Model)
        {
           
            <tr>
                <th>@user.Username</th>
                <th>@user.Fullname</th>
                <th>@user.Email</th>
                <th>@user.Roles</th>
                <th>
                    @if (user.Username.Equals(User.Identity.Name))
                    {
                        @Html.ActionLink("Sửa", "EditUser", new { id = user.Id })
                    }
                    else
                    {
                        @Html.ActionLink("Sửa", "EditUser", new { id = user.Id }) <text>|</text>
                        @Html.ActionLink("Xóa", "DeleteUser", new { id = user.Id })
                    }
                </th>
            </tr>
            
        }
    </tbody>
</table>
